package com.eeds.common.model;

import lombok.Getter;

public enum RespEnum {
	
	/**
	 * System
	 */
	SUCCESS(0, "请求成功"),
	DATABASE_CONECT_ERROR(300 , "数据库连接异常"),
	DATABASE_BIND_ERROR(301 , "数据库参数绑定异常"),
	ERROR_SYSTEM_PARAM(302, "系统参数配置错误"),
	ERROR_INNER_DATA(303, "内部数据错误"),
	GET_ERROR_SYSTEM_PARAM(304, "获取系统参数错误"),
	REDIS_CONECT_ERROR(305, "Redis连接异常"),
	SERVER_ERROR(500, "服务器正在维护，请稍后重试"),
	REQUEST_PARAM_ERROR(2000, "请求参数不正确"),
	REQUEST_REDIS_PARAM_ERROR(2001, "缓存参数不正确"),
	REQUEST_REDIS_STATUS_ERROR(2002, "缓存状态不正确"),
	USER_AUTHENTICATION(400, "用户验证失败"),
	LONG_TERM_USER_NOT_LOGGED_IN(401, "用户长期未登录"),
	SYSTEM_AUTHENTICATION(405 , "非法请求"),
	GET_MESSAGE_ERROR(406 , "获取信息失败"),


	SERVER_TASK_ERROR(502 , "定时器异常"),





	/**
	 * User
	 */
	NO_THIS_USER(3001 , "该用户不存在"),
	OLD_PASSWORD_ERROR(3002 ,"原密码有误"),
	USERNAME_PASSWORD_ERROR(3014 , "账号或者密码错误"),
	PASSWORD_IS_LOCK(3015 , "输入密码出错过多，账户已被锁定%s小时，请稍后登录。"),
	USER_PWD_FAILED(3020 , "密码修改失败"),
	USER_PWD_ERROR(3021 , "密码不正确"),
	USER_PWD_VERIFY(3022 , "新密码和确认密码输入不匹配"),
	USER_PHONE_VERIFY(3023 , "请输入注册时填写的手机号"),
	USER_AUTHENTICATION_TYPE_FAIL(3024, "第三方登录验证，类型错误，当前仅支持qq，微信，新浪微博"),
	USER_AUTHENTICATION_OUT_TIME(3025, "第三方登录验证凭证已过期"),
	USER_AUTHENTICATION_FAIL(3026 , "第三方登录失败"),
	UPDATE_MY_FILES_FAILED(3034, "修改我的信息失败"),
	OLD_PASSWORD_INCORRECT(3040, "旧密码不正确"),
	OLD_AND_NEW_PASSWORD_INCORRECT(3041, "新密码与旧密码一致，请重新填写"),
	PASSWORD_IS_NOT_SAME(3042, "您两次输入的密码不一致，请点击图标显示密码核对后再次设置"),
	USER_LOGIN_PWD_ERROR_COUNT(3043, "今日输入错误次数已达上限;请24小时后再次操作，若有疑问请联系客服"),
	USER__LOGIN_PWD_ERROR(3044, "您输入的密码有误，今日还有%s次输入机会"),
	USER_ACCOUNT_ABNORMAL(3045, "账户状态异常，请联系客服人员"),
	USER_EXIST(3046, "用户已存在"),

	VERIFICATION_CODE_HAS_FAILED(3102, "验证码已失效"),


	NO_AUTHORITY_PLEASE_CONTACT_THE_ADMINISTRATOR_TO_AUTHORIZE(1008, "没有权限，请联系管理员授权"),


	/**
	 * file
	 */
	FILE_IS_NULL(4001,"文件为空"),

	UPLOAD_FILE_ERROR(4002,"文件上传失败"),

	DIR_IS_NULL(4003, "目录不存在"),


	;

	@Getter
	private final int code;

	private final String desc;

	public String getDesc() {
		return desc;
	}

	public String getDefaultDesc() {
		return desc;
	}

	RespEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}
}
